import java.util.Arrays;

public class Solution1464 {
    public int maxProduct(int[] nums) {
        for (int i=0;i<nums.length;i++){
            nums[i]-=1;
        }
        Arrays.sort(nums);
        return Math.max(nums[0]*nums[1],nums[nums.length-1]*nums[nums.length-2]);
    }

    public static void main(String[] args) {
        System.out.println(new Solution1464().maxProduct(new int[]{3,4,5,2}));
    }
}
